﻿<UserControl x:Class="ClientOverflow.UserControls.KnowledgeSummary"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:ComponentModel="clr-namespace:System.ComponentModel;assembly=WindowsBase" mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <CollectionViewSource Source="{Binding TagsActivities}" x:Key="tagsActivitiesSource">
            <CollectionViewSource.SortDescriptions>
                <ComponentModel:SortDescription
                    PropertyName="Ratio" 
                    Direction="Ascending" />
            </CollectionViewSource.SortDescriptions>
        </CollectionViewSource>

    </UserControl.Resources>
    <ListBox ItemsSource="{Binding Source={StaticResource tagsActivitiesSource}}">
        <ListBox.ItemTemplate>
            <DataTemplate>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding TagName}" />
                    <TextBlock Text=" " />
                    <TextBlock Text="{Binding NumOfQuestions}" />
                    <TextBlock Text=" Questions asked and " />
                    <TextBlock Text="{Binding Votes}" />
                    <TextBlock Text=" votes received" />
                </StackPanel>
            </DataTemplate>
        </ListBox.ItemTemplate>
    </ListBox>
</UserControl>
